<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>附件数据管理</title>
<?php include(DEDEMEMBER."/templets/head_inc.htm"); ?>
<script type="text/javascript" language="javascript">
function ChangeImage(surl){ document.getElementById('picview').src = surl; }
//获得选中文件的文件名
function getCheckboxItem(){
	var allSel="";
	if(document.form1.aids.value) return document.form1.aids.value;
	for(i=0;i<document.form1.aids.length;i++)
	{
		if(document.form1.aids[i].checked){
			if(allSel=="")
			allSel=document.form1.aids[i].value;
			else
			allSel=allSel+","+document.form1.aids[i].value;
		}
	}
	return allSel;
}

function AllSel(){
	for(i=0;i<document.form1.aids.length;i++){
		document.form1.aids[i].checked = true;
	}
}

function NoneSel(){
	for(i=0;i<document.form1.aids.length;i++){
		document.form1.aids[i].checked = false;
	}
}

function DelSel(){
	var nid = getCheckboxItem();
	if(nid==""){
		alert("请选择项目!\r\n");
		return ;
	}
	location.href = "archives_do.php?dopost=delUploads&ids="+nid;
}
</script>
</head>
<body>
<?php include(DEDEMEMBER."/templets/head.htm"); ?>
<div class="wrapper lineT">
  <div class="mainBox">
    <div class="main">
      <?php include(DEDEMEMBER."/templets/menu.php"); ?>
      <div class="dedeMain">
        <div class="location">附件数据管理</div>
        <div class="titleTabBar bgGreen lineTB">
          <ul style='float:left;width:350px'>
            <li><a href="edit_space_info.php">空间设置</a></li>
            <li class="select"><a href="uploads.php">附件管理</a></li>
            <li><a href="edit_baseinfo.php">会员资料</a></li>
          </ul>
          <form class="fRight" name='forms' method='post' action='uploads.php' style='margin-top:3px;padding-right:10px;width:400px'>
            <input name="keyword" type="text" id="keyword" class="text" value="<?php echo $keyword?>" />
            <select name='mediatype'>
              <option value='0'>文件类型</option>
              <option value='1'<?php if($mediatype==1) echo " selected='1' "; ?>>图片</option>
              <option value='2'<?php if($mediatype==2) echo " selected='1' "; ?>>FLASH</option>
              <option value='3'<?php if($mediatype==3) echo " selected='1' "; ?>>视频/音频</option>
              <option value='4'<?php if($mediatype==4) echo " selected='1' "; ?>>其它附件</option>
            </select>
            <button class="button2 mL10" type="submit">搜索</button>
          </form>
        </div>
        <form name="form1" class="mL10 mR10 mTB10">
          <table cellspacing="1" class="list">
            <thead>
              <tr>
                <th align="left" width="1%"><input name="checkedClick" type="checkbox" value="" id="checkedClick"></th>
                <th >文件标题</th>
                <th width="5%">大小 </th>
                <th width="5%">类型 </th>
                <th width="10%">上传时间 </th>
                <th width="10%">操作</th>
              </tr>
            </thead>
            <tbody>
            
            {dede:datalist}
            <tr>
              <td><input type='checkbox' name='aids' id='aids<?php echo $fields['aid']?>' value='<?php echo $fields['aid']; ?>' class='np' /></td>
              <td><a href='<?php echo $fields['url']?>' target='_blank'><?php echo GetImageView($fields['url'],$fields['mediatype']); ?> <?php echo $fields['title']; ?> </a> </td>
              <td align="center"><?php echo GetFileSize($fields['filesize']); ?></td>
              <td align="center"><?php echo MediaType($fields['mediatype'],$fields['url']); ?></td>
              <td align="center"><?php echo MyDate("Y-m-d H:i",$fields['uptime']); ?></td>
              <td align="center"><a href='uploads_edit.php?aid=<?php echo $fields['aid']; ?>'>更改</a> | <a href='archives_do.php?dopost=delUploads&amp;aid=<?php echo $fields['aid']; ?>'>删除</a> </td>
            </tr>
            {/dede:datalist}
            </tbody>
            
            <tfoot>
              <tr>
                <td colspan="6"><div>
                    <div class="fLeft">
                      <button class="buttonGary2" onclick="DelSel();">删除</button>
                    </div>
                    <div class="pages fRight">{dede:pagelist listsize=5/}</div>
                  </div></td>
              </tr>
            </tfoot>
          </table>
        </form>
      </div>
      <div class="clear"></div>
    </div>
    <div class="clear"></div>
  </div>
</div>
<?php include(DEDEMEMBER."/templets/foot.htm"); ?>
</body>
</html>
